package com.honey.mybatis.generator.condition;

import com.honey.compilation.java.ClassDecoration;
import com.honey.core.compiler.CompilationException;
import com.honey.core.dbmapping.introspect.IntrospectSchema;
import com.honey.core.dbmapping.introspect.IntrospectSchemaColumn;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractClass;
import com.honey.mybatis.generator.MybatisPlugin;
import com.honey.mybatis.generator.criteria.CriteriaConstant;

public class ConditionClass extends AbstractClass{
	
	private static final String[] JAVA_DOC = new String[]{
		"动态查询条件。"
	};
	
	public ConditionClass(
			MybatisPlugin belongPlugin,
			IntrospectSchema introspectSchema,
			IntrospectSchemaColumn introspectSchemaColumn
			) {
		super( belongPlugin,introspectSchema,introspectSchemaColumn);
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractClass#getType()
	 */
	@Override
	protected FullyQualifiedJavaType getType() {
		return new FullyQualifiedJavaType(
				mybatisPlugin.getModelTargetPackage(),
				ConditionConstant.CONDITION_CLASS_NAME
		);
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractClass#getDecoration()
	 */
	@Override
	protected ClassDecoration getDecoration() throws CompilationException {
		ClassDecoration answer =  super.getDecoration();
		answer.setFinal(true);
		return answer;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractClass#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		
		return JAVA_DOC;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractClass#getGeneric()
	 */
	@Override
	protected FullyQualifiedJavaType getGeneric() {
		return new FullyQualifiedJavaType("<T extends "+CriteriaConstant.GENERATED_CRITERIA_CLASS_NAME+"<?, ?>>");
	}
	
	
	
}
